package net.comm.friend.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.friend.bean.BaseInvite;
import net.comm.message.bean.BaseMessage;
import net.comm.message.bean.BaseMsgcont;
import net.comm.user.bean.BaseContacts;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbInviteService implements SqlReader
{

	static Logger logger = Logger.getLogger(DbInviteService.class.getName());

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  seqID = result.getInt(1);		//
			int  invitorID = result.getInt(2);	//邀请人ID
			String  invitepath = result.getString(3);	//邀请途径
			int  userID = result.getInt(4);		//
			String  addmode = result.getString(5);		//加入网站途径
			String  status = result.getString(6);		//状态
			String  mTime = result.getString(7);		//

			// create the Resource from these fields
			return new BaseInvite( seqID, invitorID, invitepath, userID, addmode, status, mTime );
		}
		catch (SQLException e)
		{
			logger.error("取记录失败！");
			return null;
		}
		
	}
}
